//
//  wordOrdorSearchConditionCell.m
//  HCNewGoldFinger
//
//  Created by 刘琛 on 2017/12/13.
//  Copyright © 2017年 zjhcsoftios. All rights reserved.
//

#import "WordOrdorSearchConditionCell.h"
#import "UIColor+Ex.h"

@implementation WordOrdorSearchConditionCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    
    self.layer.borderColor = [UIColor colorWithHexString:@"DBDDE1"].CGColor;
    self.layer.borderWidth = 1;
    self.layer.cornerRadius = 3;
}

+ (CGSize)getCellSizeWithString:(NSString *) text {
    
    NSMutableParagraphStyle *style = [[NSParagraphStyle defaultParagraphStyle] mutableCopy];
    style.lineBreakMode = NSLineBreakByWordWrapping;
    style.alignment = NSTextAlignmentLeft;
    
    NSAttributedString *string = [[NSAttributedString alloc]initWithString:text attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:13], NSParagraphStyleAttributeName:style}];
    
    CGSize titleSize = [string boundingRectWithSize:CGSizeMake(MAXFLOAT, 20) options:NSStringDrawingUsesLineFragmentOrigin context:nil].size;
    
//     CGSize size = [text sizeWithAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIFont systemFontOfSize:13],NSFontAttributeName,nil]];
    
    return CGSizeMake(titleSize.width + 20, 30);
}


@end
